{% extends "base.html" %}
{% block css %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/item.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='css/sweetalert.css') }}">

<link rel="stylesheet" href="{{ url_for('static', filename='libs/easyui/easyui.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='libs/easyui/icon.css') }}">
{% endblock %}
{% block js %}
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/moment.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/countdown.min.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/jquery.cookie.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/sweetalert.min.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/item.js') }}"></script>

<script type="text/javascript" src="{{ url_for('static', filename='libs/easyui/jquery.easyui.min.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='libs/easyui/jquery.numberspinner.js') }}"></script>
{% endblock %}
{% block content %}
<div class="row center-block ">
    <div class="col-md-4">
        <img src="/static/img/items/{{item.id}}/title.jpg" style="width: 100%;height: 100%">
    </div>
    <div class="col-md-7">
    <div class="title"> <h2 id="title">{{item.title}}</h2> </div>
        <div class="panel panel-default panel-info">
          <div class="panel-body">
            <div id="itemid" style="display: none;">{{item.id}}</div>
             <div class="item_info"><span><strong style="color: red;font-size: 26px;"><i class="fa fa-yen fa-lg"></i>{{item.now_price}}</strong></span><!-- <span style="margin-left: 5px;font-size: 18px;">¥<del>{{item.pre_price}}</del> --><!-- <b style="padding: 0 3px;">|</b>{{('%.1f')|format(item.now_price/item.pre_price*10)}}折</span> --></div>
             <div class="item_info"><strong style="color: red;font-size: 26px;">库存<span id="inventory">{{item.inventory}}</span>件</strong></div>
             <div class="item_info">销量{{item.sold}}件</div>
             <div class="item_info">开始时间<span id="start_time">{{item.start_time.strftime('%Y-%m-%d %H:%M')}}</span></div>
             <div style="display: none;">结束时间<span id="end_time">{{item.end_time}}</span></div>
             <div class="item_info"><i class="fa fa-clock-o"></i><span id="countdown"></span></div>
             <div><span style="margin-right: 5px">数量</span><input id="numberspinner" class="easyui-numberspinner" style="width:30%;" data-options="min:10,max:{{item.inventory}},editable:true,value:1">
             <div><button id="buy"  class="btn btn-danger">立即购买</button></div>

            </div>
          </div>
        </div>
    </div>
</div>
<div class="row center-block ">
    <div class="col-md-offset-4 col-md-8">
        <span class="lead detailText">宝贝详情</span>
        <p class="text-left"><h4>{{item.desc}}</h4></p>
        <div class="detail_img" style="text-align: left;">
            {%for i in range(1,picNum+1)%}
            <img src="/static/img/items/{{item.id}}/{{i}}.jpg" style="height: 100%;width: 100%;display: inline;">
            {%endfor%}
        </div>
    </div>
</div>
{% endblock %}
